﻿@model FantasyBlog.Models.UserModel
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_CPLayout.cshtml";
}
<h2>
    Index</h2>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
@using (Html.BeginForm("Index", "User", FormMethod.Get))
{ 
    <fieldset class="filtering">
        <legend>filter</legend>
        <div>
            <b>name：</b>
            @Html.TextBoxFor(model => model.UserName)
            <b>status：</b>
            @Html.TextBoxFor(model => model.UserStatus)
            <input type="submit" value="search" />
        </div>
        <table width="100%" class="wp-list-table widefat fixed users" cellspacing="0" style="text-align: center;
            border-collapse: collapse;">
            <tr>
                <th>
                    @Html.Partial("_SmartLink", Model, new ViewDataDictionary { { "ColumnName", "username" }, { "DisplayName", "username" } })
                </th>
                <th>
                    displayname
                </th>
                <th>
                    email
                </th>
                <th>
                    @Html.Partial("_SmartLink", Model, new ViewDataDictionary { { "ColumnName", "registered" }, { "DisplayName", "registered" } })
                </th>
                <th>
                    @Html.Partial("_SmartLink", Model, new ViewDataDictionary { { "ColumnName", "status" }, { "DisplayName", "status" } })
                </th>
                <th>
                    operation
                </th>
            </tr>
            @foreach (var item in Model.list)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.username)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.displayname)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.email)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.registered)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.status)
                    </td>
                    <td>
                        @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
                        @Html.ActionLink("Details", "Details", new { id = item.ID }) |
                        @Html.ActionLink("Delete", "Delete", new { id = item.ID }) |
                        @Html.ActionLink("EditRole", "EditRole", new { id = item.ID })
                    </td>
                </tr>
            }
            <tr>
                <td colspan="6">
                    @Html.Partial("_Pager", Model)
                </td>
            </tr>
        </table>
    </fieldset>
}
